package com.qianchang.microfinance.view.tlpay;

import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.qianchang.microfinance.R;
import com.qianchang.microfinance.bean.MyBillBean;
import com.qianchang.microfinance.view.base.BaseActivity;
import com.qianchang.microfinance.view.mine.bill.MyBillAdapter;

import butterknife.BindView;
import butterknife.ButterKnife;

/***
 *   2018.7.16
 */


public class SusOrFailActivity extends BaseActivity{


    public static final int ADDCAR_SUS =1;
    public static final int ADDCAR_FAIL =2;
    public static final int UNTIED_SUS =3;
    public static final int UNTIED_FAIL =4;
    public static final int PAY_SUS =5;
    public static final int PAY_FAIL =6;

    @BindView(R.id.tv_sus_id)
    TextView tvSus;
    @BindView(R.id.tv_fail_id)
    TextView tvFail;
    @BindView(R.id.ll_fail_id)
    LinearLayout llFail;
    @BindView(R.id.ll_Sus_id)
    LinearLayout llSus;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_susorfail_layout);
        ButterKnife.bind(this);
        initView();
        initData();
    }

    @Override
    protected void initView() {
        super.initView();
        setTitle("支付结果");

    }

    @Override
    protected void initData() {
        super.initData();
        Bundle bundle = getBundle();
        int type = bundle.getInt("typeInt");
        switchType(type);
    }

    private void switchType(int enums){

        switch (enums){
            case ADDCAR_SUS:
                setTitle("绑卡成功");
                tvSus.setText("绑卡成功");
                llFail.setVisibility(View.GONE);
                llSus.setVisibility(View.VISIBLE);
                break;
            case ADDCAR_FAIL:
                setTitle("绑卡失败");
                tvFail.setText("绑卡失败");
                llFail.setVisibility(View.VISIBLE);
                llSus.setVisibility(View.GONE);
                break;
            case UNTIED_SUS:
                setTitle("解绑卡成功");
                tvSus.setText("解绑卡成功");
                llFail.setVisibility(View.GONE);
                llSus.setVisibility(View.VISIBLE);
                break;
            case UNTIED_FAIL:
                setTitle("解绑卡失败");
                tvFail.setText("解绑卡失败");
                llFail.setVisibility(View.VISIBLE);
                llSus.setVisibility(View.GONE);
                break;
            case PAY_SUS:
                setTitle("支付成功");
                tvSus.setText("已提交支付请求，请等待银行处理");
                llFail.setVisibility(View.GONE);
                llSus.setVisibility(View.VISIBLE);
                break;
            case PAY_FAIL:
                setTitle("支付失败");
                tvFail.setText("支付失败");
                llFail.setVisibility(View.VISIBLE);
                llSus.setVisibility(View.GONE);
                break;
            default:
                setTitle("标题");
                setTitle("数据有误");
                tvFail.setText("数据有误");
                llFail.setVisibility(View.VISIBLE);
                llSus.setVisibility(View.GONE);
                break;
        }
    }



}
